package com.bokee.archerwq.lab.mina.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bokee.archerwq.lab.mina.message.Request;

public class ClientAgentTestor {

	private static Logger logger = LoggerFactory
			.getLogger(ClientAgentTestor.class);

	public static void main(String[] args) {
		TimeClientAgent agent = new TimeClientAgent();
		Request request = null;
		String id = null;
		for (int i = 0; i < 5; i++) {
			String temp = "0000000000" + i;
			id = temp.substring(temp.length() - 10);
			request = new Request();
			request.setId(id);
			logger.info("request sent:[" + id + "]");
			String dateTime = agent.sendRequest(request);
			logger.info("response recieved:[" + dateTime + "]");
		}
		agent.clear();
	}

}